package com.biz.primus.model.coupon.vo.coupon.request;

import com.biz.primus.base.exception.utils.AssertUtils;
import com.biz.primus.model.coupon.exceptions.CouponExceptionType;
import com.biz.primus.model.coupon.interfaces.IModelValidation;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import lombok.Getter;
import lombok.Setter;

/**
 * 使用优惠券请求Vo
 *
 * @author david-liu
 */
@ApiModel(value = "使用优惠券请求Vo")
@Getter
@Setter
public class UseCouponReqVo implements Serializable, IModelValidation {
    private static final long serialVersionUID = -6615865963912963983L;

    @ApiModelProperty(value = "用户ID")
    private Long userId;

    @ApiModelProperty(value = "优惠券ID")
    private Long couponId;

    @Override
    public void validate() {
        AssertUtils.notNull(couponId, CouponExceptionType.COUPON_ID_NOT_ALLOW_NULL);
        AssertUtils.notNull(userId, CouponExceptionType.COUPON_USER_NOT_ALLOW_NULL);
    }
}
